export default {
	//获取用户信息
	userInfo(state) {
		if (state.userInfo) {
			// console.log('getters', JSON.stringify(state.userInfo));
			return state.userInfo;
		} else {
			try {
				let userInfo = uni.getStorageSync("userInfo");
				if (userInfo) {
					state.userInfo = userInfo
					return userInfo;
				} else {
					return ''
				}
			} catch (error) {
				return '';
			}
		}
	},
	// 是否登陆
	getLogin(state) {
		if (state.token) {
			console.log('getters', state.token);
			return state.token
		} else {
			try {
				let token = uni.getStorageSync("token");
				if (token) {
					state.token = token
					return token
				} else {
					return ''
				}
			} catch (error) {
				state.token = '';
				return ''
			}
		}
	},
	getTokenPriceList(state) {
		return state.tokenPriceList
	},
	getWalletAddress(state) {
		return state.walletAddress || uni.getStorageSync("walletAddress") || "";
	},
	getWalletPrivateKey(state) {
		return state.walletPrivateKey || uni.getStorageSync("walletPrivatekey") || "";
	},
	getNftConfig(state) {
		return state.nftConfig || uni.getStorageSync("nftConfig") || "";
	}
}